<?php echo $header;?>

<?php if(isset($authority_showuserdata)){?>
<div id="column-left">
<div class="box" >
<div class="box-heading"><?php echo $user["nickname"]; ?> </div>
<div class="box-content">注册时间:<?php echo $user["date_added"];?></div>
</div>
</div>
<?php } ?>

<div id="column-right">
<?php if(isset($authority_addcomment)){?>
		<div class="box" >
		<div class="box-heading">添加评论</div>
		<form action="<?php echo $action_addcomment;?>" method="post" enctype="multiple/form-data" >
			<input type="hidden" name="plan_id" value="<?php echo $plan["plan_id"];?>"/>
			<input type="hidden" name="from_user_id" value="<?php echo $from_user_id;?>"/>
			<input type="hidden" name="user_id" value="<?php echo $user_id;?>"/>
			<div class="box-content"><textarea name="comment_content" cols="17"></textarea></div>	
			<div class="box-content"><input type="submit" value="确定"/></div>
		</form>
		</div>
<?php }?>	
	<div class="box" >
	<div class="box-heading" >评论</div>
	<?php if(isset($comments)){
				foreach($comments as $comment){?>
					<div class="box-content">
					<div class="left">
						<a href="<?php echo $action_checkplan.$comment["user_id"];?>"><?php echo $comment["nickname"];?></a>说:
						</div><div><?php echo $comment["comment_content"];?></div><div class="right"><?php echo $comment["date_added"];?></div></div>
				<?php }
		} 
			?>
	</div>
</div>

<div id="content">

<a class="button" href="<?php echo $back;?>"><span>返回</span></a>

<div class="box">
	<div class="box-heading" ><?php echo $plan["status_content"].'('.$plan["type"].')';?></div>
	<div class="box-content"><?php echo $plan["content"];?></div>
</div>

		<div class="box" >
		<div class="box-heading">笔记</div>
		<?php if(isset($authority_addnote)){?>
		<form action="<?php echo $action_addnote;?>" method="post" enctype="multiple/form-data" >
			<input type="hidden" name="plan_id" value="<?php echo $plan["plan_id"];?>"/>
			<div class="box-content"><textarea name="note_content" cols="100" ></textarea></div>	
			<div class="box-content"><input type="submit" value="添加笔记"/></div>
		</form>
		<?php }?>			
		<?php if(isset($notes)){
			foreach($notes as $note){?>
				<div class="box-content"><?php echo $note["note_content"];?><div class="right"><?php echo $note["date_added"];?></div></div>
			<?php }
		}
		?>
		</div>
		
	<?php if(isset($checkin)){ ?>		
		
			<?php if(isset($authority_checkin)){?>
			<div class="box-content">	
				<form action="<?php echo $checkin;?>" method="post" enctype="multiple/form-data" >
					<div class="box" >
					<input type="hidden" name="plan_id" value="<?php echo $plan["plan_id"];?>"/>
					<div class="box-heading" style="background:#2963F8;">今日完成计划签到(<?php echo $today;?>)</div>
					<div class="box-content"><textarea name="checkin_note" cols="100" ></textarea></div>								
					<div class="box-content"><input type="submit" value="完成计划签到"/></div>
					</div>
				</form>
			</div>
	<?php }}?>
			
					<?php if(isset($allcheckins)){ ?>
						<div class="box" >
						<div class="box-heading">签到记录:</div>
						<div class="box-content">	
						<?php foreach($allcheckins as $checkin){
								if($checkin["status"]==1){
									?>
									<div class="box">
										<div class="box-heading" ><?php echo $checkin["date_checkin"]."(已完成)";?></div>
										<div class="box-content"><?php echo $checkin["checkin_note"];?></div>
									</div>
									<?php
								}else{
									?>
									<div class="box">
										<div class="box-heading" style="background:#E11931;"><?php echo $checkin["date_checkin"]."(未完成)";?></div>
										<div class="box-content"></div>
									</div>
									<?php
								}
							} ?>
						</div>
					<?php }?>
		</div>
	
</div>
<?php echo $footer;?>